﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project1.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Project1" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title><asp:Literal runat="Server" id="litTitle"/></title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <script type="text/javascript" src="../../Scripts/Common.js"></script>
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-1.9.1.min.js"></script>
    <link rel="Stylesheet" href="../../Styles/StyleSheet.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
            
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="100">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnlHeader">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlHeader" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlView" LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="pnlView">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlHeader" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlView" LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="pnlInfo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnChangeExp">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="btnChangeExp" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="tvlOperation">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tvlOperation" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="tvlExpense">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tvlExpense" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            var bodyOverflow, htmlOverflow; function closeHandler(sender, args) { document.body.style.overflow = bodyOverflow; document.documentElement.style.overflow = htmlOverflow; sender.remove_close(closeHandler); }
            function OpenPopUpHideParentScrollBar(url, radwindowId) { bodyOverflow = document.body.style.overflow; htmlOverflow = document.documentElement.style.overflow; document.body.style.overflow = "hidden"; document.documentElement.style.overflow = "hidden"; var oWnd = radopen(url, radwindowId); oWnd.add_close(closeHandler); }

            var mode = 1;
            var approve = 1;
            function execPositionsTrue() {
                approve = 1;
            }
            function conFirmDel(str) {
                if (mode == 1) {
                    return confirm(str);
                }
            }
            function conFirmApr(str) {
                if (mode == 1 && approve == 1) {
                    return confirm(str);
                }
            }

            function openProjectExpenseDetails(id, status) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_Expense.aspx?source=" + id + "&type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectOptionDetails(id) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                        
                    OpenPopUpHideParentScrollBar("BGM_Project_Option.aspx?optType=" + id + "&type=" + type, "ProjectDtls");
                    return false;
                }
            }

            function openProjectExpensePlanDetails(status) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_Expense_Plan.aspx?type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectWorkPlanDetails(status) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_work_Plan.aspx?type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectManagerDetails() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_Manager.aspx?type=" + type, "ProjectDtls");
                    return false;
                }
            }

            <%--function openProjectKPISDetails() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_KPI_New.aspx?type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }--%>

            function openProjectKPISDetails() {
                if (mode == 1) {
                    var seq = document.getElementById("<%= lblProjectSeq.ClientID %>").value;
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    var year = document.getElementById("<%= lbBgmYear.ClientID %>").innerText;
                    OpenPopUpHideParentScrollBar("BGMKPIList.aspx?seq=" + seq + "&type=" + type + "&year=" + year + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectAssignDetails() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;

                    OpenPopUpHideParentScrollBar("BGM_Project_ReaderDtls.aspx", "AssignJob");
                    return false;
                }
                return true;
            }

            function openChangeExp() {

                var hid = document.getElementById("<%= lblProjectSeq.ClientID %>").value;

                OpenPopUpHideParentScrollBar("BGM_Project_Expense_Change.aspx?hid=" + hid, "ExpenseChange");

                return false;
            }

            function getParameterByName(name) {
                name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
                var regexS = "[\\?&]" + name + "=([^&#]*)";
                var regex = new RegExp(regexS);
                var results = regex.exec(window.location.search);
                if (results == null)
                    return "";
                else
                    return decodeURIComponent(results[1].replace(/\+/g, " "));
            }

            function openProjectPrintPreview() {
                var type = document.getElementById("<%= lblType.ClientID %>").value;
                OpenPopUpHideParentScrollBar("BGM_Project_PrintPreview.aspx?type=" + type, "PrintPreview");
                return false;
            }

            function openSendMessage() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_SendMessage.aspx?type=" + type + "&jobsiteid=" + '<%= Request["id"] %>', "Approve");
                    return false;
                }
            }

            function openJobSitePass() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    OpenPopUpHideParentScrollBar("BGM_Project_Pass.aspx?type=" + type, "Pass");
                    return false;
                }
            }

            function openProjectOperationReport(seq, status) {

                OpenPopUpHideParentScrollBar("BGM_ProjectOperationReport.aspx?seq=" + seq + "&status=" + status, "ProjectOperationReport");

                return false;
            }

            function closeRadWindow(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('');
            }

            function closeRadWindow2(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('refresh');
            }

            function closeRadWindow3(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('JobSitePass');
            }

            function closeRadWindow4(sender, args) {
                return false;
            }

            function isNumberKey(event) {
                var charCode = (event.which) ? event.which : event.keyCode
                if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                    return false;
                }
                return true;
            }

            function openReport(key) {
                OpenPopUpHideParentScrollBar("../Report/Report.aspx?key=" + key + "&case=201", "ProjectDtls");
            }

            function openShowAllReport() {
                OpenPopUpHideParentScrollBar("../../Reports/RPT_Exports.aspx", "Popup");
            }

            var cancelDropDownClosing = false;

            function onClickLink(i) {
                mode = i;
            }
            function onTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }
            function StopPropagation(e) {
                e.cancelBubble = true;
                if (e.stopPropagation) {
                    e.stopPropagation();
                }
            }

            function OnClientDropDownClosingHandler(sender, e) {
                e.set_cancel(cancelDropDownClosing);
            }

            function HideTooltipCurrent() {
                var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
                if (tooltip) tooltip.hide();
            }

            setInterval(DisableAnchor, 100);

            function DisableAnchor() {
                $('a').each(function () {
                    if ($(this).attr('disabled')) {
                        $(this).css("color", "silver");
                        $(this).removeAttr('onclick', '');
                    }
                    $(this).click(function (e) {
                        //alert('click');
                        if ($(this).attr('disabled')) {

                            //alert('disabled');
                            e.preventDefault();
                            e.stopImmediatePropagation();
                        } else {
                            //alert('not disabled');
                        }
                    });
                    var events = $._data ? $._data(this, 'events') : $(this).data('events');
                    events.click.splice(0, 0, events.click.pop());
                }); 
            }

        </script>
    </telerik:RadCodeBlock>

    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
        ReloadOnShow="true" runat="server" Skin="Web20" Modal="true" KeepInScreenBounds="true" Style="z-index: 7001">
        <Windows>
            <telerik:RadWindow ID="ProjectDtls" runat="server" Width="950px" Height="600px" Behaviors="Reload, Close, Move" OnClientClose="closeRadWindow">
            </telerik:RadWindow>
            <telerik:RadWindow ID="Approve" runat="server" Width="800px" Height="350px" Behaviors="Reload, Close, Move, Resize" OnClientClose="closeRadWindow2">
            </telerik:RadWindow>
            <telerik:RadWindow ID="PrintPreview" runat="server" Width="850px" Height="500px" Behaviors="Reload, Close, Move">
            </telerik:RadWindow>
            <telerik:RadWindow ID="AssignJob" runat="server" Width="850px" Height="500px" Behaviors="Reload, Close, Move">
            </telerik:RadWindow>
			<telerik:RadWindow ID="Pass" runat="server" Width="550px" Height="250px" Behaviors="Reload, Close, Move" OnClientClose="closeRadWindow3">
            </telerik:RadWindow>
            <telerik:RadWindow ID="ProjectOperationReport" runat="server"  Width="800px" Height="600px" Behaviors="Reload, Close, Move" OnClientClose="closeRadWindow4">
            </telerik:RadWindow>
            <telerik:RadWindow ID="ExpenseChange" runat="server"  Width="900px" Height="600px" Behaviors="Reload, Close, Move" OnClientClose="closeRadWindow4">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    <div class="defaultFont" style="padding: 0px 10px 10px 10px">
        <asp:Panel ID="pnlHeader" runat="server" style="position: fixed; width: 100%; top: 0px; left: 0px; z-index: 7000; background-color: #FFFFFF;">
            <div class="header-grid" ><%--D8DFEA--%>
                <table width="100%">
                    <tr>
                        <td>
                            <asp:LinkButton ID="btnAddNew" runat="server" OnClick="btnAddNew_Click" CssClass="ControlLinkButton">
                                <img height="16px" alt="" src="../Image/MetroIcon/add.png" />
                                &nbsp;เพิ่มโครงการใหม่
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnEdit" runat="server" CssClass="ControlLinkButton"
                                OnClick="btnEdit_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/edit.png" />
                                &nbsp;แก้ไขข้อมูลโครงการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnSaveAddNew" runat="server" CssClass="ControlLinkButton"
                                OnClick="btnSaveAddNew_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/save.png" />
                                &nbsp;บันทึกรายการใหม่
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnSaveEdit" runat="server" CssClass="ControlLinkButton"
                                OnClick="btnSaveEdit_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/save.png" />
                                &nbsp;บันทึกแก้ไขรายการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnCancel" runat="server" CssClass="ControlLinkButton"
                                OnClick="btnCancel_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/cancel.png" />
                                &nbsp;ยกเลิกแก้ไข
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnDelete" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="javascript:return conFirmDel('ยืนยันการลบข้อมูลที่เลือก')" 
                                OnClick="Delete_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/delete.png" />
                                &nbsp;ยกเลิกโครงการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnEndProject" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="javascript:return conFirmDel('ต้องการปิดโครงการนี้หรือไม่?')" 
                                OnClick="btnEndProject_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/delete.png" />
                                &nbsp;ปิดโครงการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnPrintPreview" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openProjectPrintPreview()">
                                <img height="16px" alt="" src="../Image/MetroIcon/print.png" />
                                &nbsp;แสดงข้อมูลก่อนพิมพ์
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnApprove" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openSendMessage()">
                                <img height="16px" alt="" src="../Image/MetroIcon/check.png" />
                                &nbsp;ส่งคำขอไป ผอ.
                            </asp:LinkButton>
                        </td>
                        <td align="right">
                            <asp:Label ID="lblApproved" runat="server" Text="" Font-Size="Medium" />
                        </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
        <br />
        <br />
        <asp:Panel ID="pnlView" runat="server">
            <br />
            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="dtgProj" 
				runat="server" AutoGenerateColumns="false"
                AllowMultiRowEdit="false"
                AllowMultiRowSelection="false" 
                ShowStatusBar="false" AllowPaging="false" 
                AllowSorting="True" AllowFilteringByColumn="true"
                Width="960px" Height="540px"
                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                GroupingSettings-GroupContinuedFormatString=""
                GroupingSettings-GroupContinuesFormatString=""
                GroupingSettings-GroupSplitFormat=""
                OnNeedDataSource="dtgProj_NeedDataSource"
                OnEditCommand="dtgProj_EditCommand">
                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" Width="100%"
                    DataKeyNames="Sequence" NoMasterRecordsText="< ไม่มีข้อมูล >">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Sequence"
                            UniqueName="Sequence" Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="record_status" 
                            UniqueName="record_status" Visible="False">
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn AllowFiltering="false">
                            <FilterTemplate></FilterTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="cmdEdit" runat="server" CommandName="Edit"
                                    ImageUrl="~/App_UI/Image/Buttons/Magnifier.gif" ToolTip="แสดงรายละเอียด" />
                            </ItemTemplate>
                            <HeaderStyle Width="28px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridTemplateColumn>

                        <telerik:GridBoundColumn DataField="bgm_prj_code" HeaderText="รหัสรายการ"
                            UniqueName="bgm_prj_code" AutoPostBackOnFilter="true" Visible="False"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False"> 
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="bgm_prj_name" HeaderText="ชื่อโครงการ"
                            UniqueName="bgm_prj_name" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False"> 
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left"/>
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="date_start" HeaderText="วันที่เริ่มต้น"
                            UniqueName="date_start" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:d}">
                            <HeaderStyle Width="120px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="date_end" HeaderText="วันที่สิ้นสุด"
                            UniqueName="date_end" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:d}">
                            <HeaderStyle Width="120px"  HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Left"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="total_amount" HeaderText="วงเงินรวม(บาท)"
                            UniqueName="total_amount" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:n2}">
                            <HeaderStyle Width="120px"  HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="record_status_name" HeaderText="สถานะรายการ"
                            UniqueName="record_status_name" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False">
                            <HeaderStyle Width="120px"  HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Left"/>
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                        FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                        NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                        PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                </MasterTableView>
                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                    GroupContinuedFormatString="" GroupContinuesFormatString="" 
                    GroupSplitFormat="" />
                <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                    <Selecting AllowRowSelect="false" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>

        <asp:Panel ID="pnlInfo" runat="server">
            <br />
            <asp:HiddenField ID="lblType" runat="server"></asp:HiddenField> 
            <asp:HiddenField ID="lblProjectSeq" runat="server"></asp:HiddenField>      
            <asp:HiddenField ID="lblJobSiteSeq" runat="server"></asp:HiddenField>   
            <asp:HiddenField ID="lblExecPosSeq" runat="server"></asp:HiddenField>
            <asp:Panel id="PanelReplyRemarks" runat="server" Visible="false">
                <div class="DivInfo">
                    <asp:Label ID="lblReplyRemark" runat="server" ForeColor="Red" />
                </div>
            </asp:Panel>
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr valign="top">
                    <td width="500px">
                        <table cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td width="130px" align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-left: 5px; padding-bottom: 2px; padding-top: 20px;">
                                    ปีงบประมาณ :
                                </td>
                                <td align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-bottom: 2px; padding-top: 20px;">
                                    <asp:Label ID="lbBgmYear" runat="server" Text="-"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn">
                                    วันที่บันทึก :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjDate" runat="server" Text="-"></asp:Label>
                                    <uc1:DatePicker ID="txtProjDate" runat="server" />  
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                        </table>
                        <asp:Panel ID="pnlCode" runat="server" BackColor="#D8DFEA">
                            <table cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td width="130px" align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-left: 5px; padding-bottom: 2px; padding-top: 20px;">
                                    รหัสโครงการ :
                                </td>
                                <td align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-bottom: 2px; padding-top: 20px;">
                                    <asp:Label ID="lblProjCode" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox CssClass="defaultTextbox" ID="txtProjCode" runat="server" Width="80%" Visible="false" AutoCompleteType="Disabled"></telerik:RadTextBox>
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn">
                                    รหัส GFMIS :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lblGFMISCode" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtGFMISCode" runat="server" Width="80%" Visible="false" AutoCompleteType="Disabled"></asp:TextBox> 
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                        </table>
                        </asp:Panel>
                        <table cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn">
                                    ชื่อโครงการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbPrefix" runat="server" Text="โครงการ " Visible="false" />
                                    <asp:Label ID="lbProjName" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjName" runat="server" Width="80%" Visible="false" AutoCompleteType="Disabled"></asp:TextBox>
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn">
                                    กิจกรรมย่อย :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjStrat" runat="server" Text="-"></asp:Label>
                                    <telerik:RadComboBox ID="ddlStrategy" runat="server" Visible="false"
                                        AllowCustomText="true" CausesValidation="false" DataTextField="text" 
                                        DataValueField="value" EmptyMessage="---- พิมพ์ที่นี่เพื่อค้นหากิจกรรมย่อย ----"
                                        Filter="Contains" OnClientTextChange="onTextChange" Width="80%">
                                    </telerik:RadComboBox>
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn">
                                    หน่วยงานหลัก :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjJobSiteMain" runat="server" Text="-" />
                                    <telerik:RadComboBox ID="ddlJobSite" runat="server" Visible="false"
                                        AllowCustomText="true" CausesValidation="false" DataTextField="text" 
                                        DataValueField="value" EmptyMessage="---- พิมพ์ที่นี่เพื่อค้นหาหน่วยงาน ----" 
                                        Filter="Contains" OnClientTextChange="onTextChange" Width="80%" 
                                        Enabled="true" AutoPostBack="True" />
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" width="130px">
                                    หน่วยงานรอง :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjJobSite" runat="server" Text="-" />
                                    <asp:Label ID="lbProjJobSiteSeq" runat="server" Visible="false" />
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn">
                                    หัวหน้าสำนัก:
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lblJobSiteHeadPos" runat="server" Text="" />
                                    <asp:Label ID="lblJobSiteHeadPosLoadError" runat="server" Text="" ForeColor="Red" />
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    หน่วยงานเพื่อทราบ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn" valign="top">
                                    <asp:Repeater ID="repeaterJobSitePass" runat="server" 
                                        OnItemCommand="repeaterJobSitePass_ItemCommand">
                                        <ItemTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:ImageButton ID="cmdDelete" runat="server" CommandName="Delete"
                                                            ImageUrl="~/App_UI/Image/Grid/Delete.gif"
                                                            OnClientClick="javascript:return conFirmDel('ยืนยันการลบข้อมูลที่เลือก')" 
                                                            ToolTip="ลบรายการ" />
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="lblBgmReqPassSeq" runat="server" Visible="false" Text='<%# Eval("bgm_req_pass_seq") %>' />
                                                            <%# Eval("job_site_name") %>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <asp:LinkButton ID="btnJobSitePass" runat="server" CssClass="LinkButton" OnClientClick="openJobSitePass()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;เพิ่มหน่วยงานเพื่อทราบ</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" width="120px">
                                    วันที่เริ่มต้น :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lblStartDate" runat="server" Text="-"></asp:Label>
                                    <uc1:DatePicker ID="txtStartDate" runat="server" />
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" width="120px">
                                    วันที่สิ้นสุด :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lblEndDate" runat="server" Text="-"></asp:Label>
                                    <uc1:DatePicker ID="txtEndDate" runat="server" />
                                   <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" width="120px">
                                    ประเภทโครงการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjType" runat="server" Text="-"></asp:Label>
                                    <telerik:RadComboBox ID="ddlProjType" runat="server" AllowCustomText="true" 
                                        CausesValidation="false" DataTextField="text" DataValueField="value" 
                                        EmptyMessage="... พิมพ์ที่นี่เพื่อค้นหาประเภทโครงการ ..." Filter="Contains" 
                                        OnClientTextChange="onTextChange" Visible="false" Width="270px">
                                    </telerik:RadComboBox>
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" width="120px">
                                    พื้นที่ดำเนินการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjScope" runat="server" Text="-"></asp:Label>
                                    <telerik:RadComboBox ID="ddlProjScope" runat="server" AllowCustomText="true" 
                                        CausesValidation="false" DataTextField="text" DataValueField="value" 
                                        EmptyMessage="... พิมพ์ที่นี่เพื่อค้นหาพื้นที่ดำเนินการ ..." Filter="Contains" 
                                        OnClientTextChange="onTextChange" Visible="false" Width="270px">
                                    </telerik:RadComboBox>
                                    <span class="span">&nbsp;*</span>
                                </td>
                            </tr>
                
                            <tr>
                                <td width="130px" align="left" 
                                    style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-left: 5px; padding-bottom: 2px; padding-top: 12px;" 
                                    valign="top" width="25%">
                                    หลักการและเหตุผล :
                                </td>
                                <td align="left" 
                                    style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-bottom: 2px; padding-top: 12px;">
                                    <asp:Label ID="lbProjReason" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjReason" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%"></telerik:RadTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    วัตถุประสงค์ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjObject" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjObject" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%"></telerik:RadTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    ผลผลิตของโครงการ:
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjTarget" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjTarget" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%"></telerik:RadTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    วิธีการดำเนินการ/กิจกรรม :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjPlan" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjPlan" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%" ></telerik:RadTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    กลุ่มเป้าหมาย :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjAim" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjAim" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%" ></telerik:RadTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    ประโยชน์ที่คาดว่าจะได้รับ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjProfit" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjProfit" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%" ></telerik:RadTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td width="130px" align="left" class="defaultTableLineLeftColumn" valign="top">
                                    หมายเหตุ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjRemark" runat="server" Text="-"></asp:Label>
                                    <telerik:RadTextBox ID="txtProjRemark" runat="server" CssClass="defaultTextbox" 
                                        height="80px" TextMode="MultiLine" Visible="false" Width="95%"></telerik:RadTextBox>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        <br />
                        <table cellpadding="0" cellspacing="0" width="100%" style="padding-left: 30px;">
                            <tr>
                                <%--<td align="left" class="defaultTableLineLeftColumn" width="120px">
                                    ระยะเวลาดำเนินการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">--%>
                                <td align="right">
                                    <asp:Label ID="lbWorkPlanEmpty" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                    <asp:LinkButton ID="btnWorkPlan" runat="server" CssClass="LinkButton" 
                                        OnClientClick="openProjectWorkPlanDetails()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />
                                        &nbsp;แสดงแผนการดำเนินงาน
                                    </asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <%--<td align="left" class="defaultTableLineLeftColumn" width="120px">
                                    ตัวชี้วัดความสำเร็จ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">--%>
                                <td align="right" style="padding-top: 15px;">
                                    <asp:Label ID="lbKPIEmpty" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                    <asp:LinkButton ID="btnKPI" runat="server" CssClass="LinkButton" 
                                        OnClientClick="openProjectKPISDetails()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />
                                        &nbsp;แสดงตัวชี้วัดความสำเร็จ
                                    </asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                        <asp:Panel ID="pnlAssignProjectPopup" runat="server">
                            <table cellpadding="0" cellspacing="0" width="100%" style="padding-left: 30px;">
                                <tr>
					                <%--<td align="left" width="120px" class="defaultTableLineLeftColumn">
						                มอบหมายงาน
					                </td>
					                <td align="left" class="defaultTableLineRightColumn">--%>
                                    <td align="right" style="padding-top: 15px;">
                                        <asp:Label ID="lblAssignNoData" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                        <asp:LinkButton ID="lkbAssignProjectPopup" runat="server" CssClass="LinkButton" OnClientClick="openProjectAssignDetails()" >
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;แสดงการมอบหมายงานภายในโครงการ
                                        </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <table cellpadding="0" cellspacing="0" width="100%" style="padding-left: 30px;">
                            <tr valign="top">
                                <td align="right" style="padding-top: 10px;">
                                    <asp:Label ID="lbGridSource" runat="server" CssClass="defaultFont" Text="<<< คลิ๊กที่ชื่อแหล่งเงินเพื่อบันทึกรายงาน 202 >>>" ForeColor="#999999" Visible="false" />
                                </td>
                            </tr>
                            <tr valign="top">
                                <td align="right" style="padding-top: 10px;">
                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridSource" runat="server" 
                                        AutoGenerateColumns="False" 
                                        GridLines="None" MasterTableView-GridLines="None" 
                                        Width="100%">
                                        <mastertableview ShowFooter="true" NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" datakeynames="bgm_source_seq" width="100%">                                                           
                                        <Columns>
                                            <telerik:GridTemplateColumn AllowFiltering="false" Visible="false">
                                                <HeaderStyle Width="20px"></HeaderStyle>
                                                <ItemStyle Height="20px"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="addControl" BorderWidth="0px" ImageUrl="../Image/Grid/Magnifier.gif"
                                                        OnClientClick='<%# string.Format("return openProjectExpenseDetails(\"{0}\",\"{1}\");"
                                                            , Eval("bgm_source_seq"), Eval("total_amount")) %>'
                                                        AlternateText="รายละเอียด" Style="float: right; cursor: pointer;" runat="server">
                                                    </asp:ImageButton>
                                                </ItemTemplate>
                                                                            
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="Sequence" runat="server" Text='<%# Eval("bgm_source_seq") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="bgm_source_name"
                                                FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                                HeaderText="แหล่งเงิน" ItemStyle-HorizontalAlign="Left" 
                                                FooterText="รวมทั้งหมด :"
                                                UniqueName="bgm_source_name" >
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <FooterStyle Font-Bold="true" HorizontalAlign="Center" /> 
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="total_amount"
                                                Aggregate="Sum"
                                                FooterAggregateFormatString="{0:#,##0}"
                                                DataFormatString="{0:#,##0}"
                                                HeaderStyle-HorizontalAlign="Center"
                                                HeaderText="วงเงินขอ(บาท)" 
                                                UniqueName="total_amount" Visible="true">
                                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                <FooterStyle Font-Bold="true" HorizontalAlign="Right" />
                                                <ItemStyle HorizontalAlign="Right" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="approve_amount"
                                                Aggregate="Sum"
                                                FooterAggregateFormatString="{0:#,##0}"
                                                DataFormatString="{0:#,##0}"
                                                HeaderStyle-HorizontalAlign="Center"
                                                HeaderText="อนุมัติ(บาท)" 
                                                UniqueName="approve_amount" Visible="false">
                                                <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                                <FooterStyle Font-Bold="true" HorizontalAlign="Right" />
                                                <ItemStyle HorizontalAlign="Right" />
                                            </telerik:GridBoundColumn>
                                                                        
                                        </Columns>
                                        </mastertableview>
                                    <clientsettings>
                                        <clientevents /><selecting allowrowselect="True" /></clientsettings>
                                </telerik:RadGrid>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="padding-top: 5px;">
                                    <asp:LinkButton ID="btnExpPlan" runat="server" CssClass="LinkButton" OnClientClick="openProjectExpensePlanDetails()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;แสดงแผนการใช้จ่ายงบประมาณ</asp:LinkButton>
                                    <asp:Label ID="lbExpPlanEmpty" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                </td>
                            </tr>
                            <tr valign="top">
                                <td align="right" style="padding-top: 30px;">
                                    <asp:LinkButton ID="btnManager" runat="server" CssClass="LinkButton" OnClientClick="openProjectManagerDetails();"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;ระบุรายชื่อผู้รับผิดชอบโครงการ</asp:LinkButton>
                                </td>
                            </tr>
                            <tr valign="top">
                                <td style="padding-top: 5px;">
                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridManager" runat="server" 
                                        AutoGenerateColumns="False"
                                        GridLines="None" MasterTableView-GridLines="None" 
                                        Width="100%">
                                        <mastertableview NoMasterRecordsText="... ไม่มีข้อมูล ..." commanditemdisplay="none" datakeynames="bgm_proj_mng_seq" width="100%">                                                           
                                        <Columns>
                                            <telerik:GridTemplateColumn Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbManagerSeq" runat="server" Text='<%# Eval("bgm_proj_mng_seq") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridTemplateColumn HeaderStyle-Width="50%" 
                                                HeaderStyle-HorizontalAlign="Center" HeaderText="ผู้รับผิดชอบโครงการ" ItemStyle-HorizontalAlign="Left"> 
                                                <ItemTemplate>
                                                    <asp:Label ID="full_name" runat="server" NavigateUrl="#" Text='<%# Eval("name") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                                                        
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                CurrentFilterFunction="Contains" 
                                                DataField="pos_name" 
                                                FilterControlWidth="100%" 
                                                HeaderText="ตำแหน่ง" 
                                                ShowFilterIcon="false" 
                                                UniqueName="pos_name" Visible="true">
                                                <HeaderStyle HorizontalAlign="Center" Width="200px"/>
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                                                        
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                CurrentFilterFunction="Contains" 
                                                DataField="tel" 
                                                FilterControlWidth="100%" 
                                                HeaderText="โทร" 
                                                ShowFilterIcon="false" 
                                                UniqueName="tel" Visible="true">
                                                <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                                                        
                                        </Columns>
                                        </mastertableview>
                                    <clientsettings>
                                        <clientevents /><selecting />
                                    </clientsettings>
                                </telerik:RadGrid>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Panel ID="PanelOption" runat="server" Visible="true">
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="pnlOperation" runat="server">
            <br />
            <div class="DivInfo" style="font-weight:bold;">
                <table width="100%">
                    <tr>
                        <td>
                            ข้อมูลค่าใช้จ่ายคงเหลือในโครงการ
                        </td>
                        <td align="right">
                            <asp:LinkButton ID="btnChangeExp" runat="server" Text="แก้ไขข้อมูลค่าใช้จ่าย" 
                                CssClass="LinkButton" OnClientClick="openChangeExp()" />
                        </td>
                    </tr>
                </table>
            </div>
            <telerik:RadTreeList ID="tvlExpense" runat="server" AutoGenerateColumns="false"
                DataKeyNames="child_value" ParentDataKeyNames="parent_value" AllowLoadOnDemand="false"
                Width="945px" OnNeedDataSource="tvlExpense_NeedDataSource">
                <Columns>
                    <telerik:TreeListBoundColumn DataField="child_value" UniqueName="child_value" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="parent_value" UniqueName="parent_value" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="text" UniqueName="text" HeaderText="แหล่งเงิน/ค่าใช้จ่าย">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="cal_amount" UniqueName="cal_amount" HeaderText="จำนวนเงินคงเหลือ (บาท)"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="150px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                </Columns>
            </telerik:RadTreeList>
            <table width="100%">
                <tr>
                    <td align="right">
                        รวม :
                    </td>
                    <td width="150px" align="right">
                        <asp:Label ID="lblSumExpense" runat="server" ForeColor="Blue" />
                    </td>
                    <td width="3px">
                    </td>
                </tr>
            </table>
            <br />
            <div class="DivInfo" style="font-weight:bold;">
                ประวัติการเปลี่ยนแปลงค่าใช้จ่าย
            </div>
            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridReport5" runat="server" AllowMultiRowSelection="false"
                AutoGenerateColumns="False" OnItemDataBound="gridReport5_ItemDataBound" 
                GridLines="None" MasterTableView-GridLines="None" Width="945px">
                <mastertableview ShowFooter="true" NoMasterRecordsText="... ไม่มีข้อมูล ..." 
                    CommandItemDisplay="none" width="100%" GroupLoadMode="Client">
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <groupbyfields>
                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="&nbsp;" />
                        </groupbyfields>
                        <selectfields>
                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน :" HeaderValueSeparator="" />
                        </selectfields>
                    </telerik:GridGroupByExpression>
                    <telerik:GridGroupByExpression>
                        <groupbyfields>
                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="&nbsp;" />
                        </groupbyfields>
                        <selectfields>
                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย :" HeaderValueSeparator="" />
                        </selectfields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="bgm_proj_exp_seq" UniqueName="bgm_proj_exp_seq" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="created_when"
                        FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="รายการ" ItemStyle-HorizontalAlign="Left" 
                        UniqueName="created_when"><%--DataFormatString="{0:d}"--%>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                        FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ค่าใช้จ่าย" ItemStyle-HorizontalAlign="Left" 
                        UniqueName="bgm_exp_name" >
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="cal_amount"
                        HeaderText="วงเงิน (บาท)" Aggregate="Sum"
                        DataFormatString="{0:#,##0.00}"
                        HeaderStyle-HorizontalAlign="Center"
                        UniqueName="cal_amount" Visible="true">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                </Columns>
                </mastertableview>
                <ClientSettings>
                    <Selecting AllowRowSelect="false" />
                </ClientSettings>
            </telerik:RadGrid>
            <br />
            <br />
            <div class="DivInfo" style="font-weight:bold;">
                <table width="100%">
                    <tr>
                        <td>
                            ขออนุมัติดำเนินงาน
                        </td>
                        <td align="right">
                            <asp:Image ID="imgTooltip" runat="server" ImageUrl="~/APP_UI/Image/Buttons/tip.png" Height="20px" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="imgTooltip" RelativeTo="Element"
                                Position="MiddleLeft" RenderInPageRoot="true" AutoCloseDelay="0">
                                <h2>ความหมายของข้อมูลการใช้จ่ายเงินในการดำเนินงาน</h2>
                                <hr style="border:1px solid" />
                                <div style="text-align:left">
                                    <ul>
                                        <li style="padding-bottom:10px">
                                            <b>(1)ได้รับอนุมัติ : </b>จำนวนเงินที่ได้รับอนุมัติ
                                        </li>
                                        <li style="padding-bottom:10px">
                                            <b>(2)จองเงิน : </b>จำนวนเงินที่อยู่ในขั้นตอนตั้งแต่ขอจัดซื้อจัดจ้าง
                                        </li>
                                        <li style="padding-bottom:10px">
                                            <b>(3)ตั้งเบิก : </b>จำนวนเงินที่ผ่านการอนุมัติเบิกแล้ว
                                        </li>
                                        <li style="padding-bottom:10px">
                                            <b>(4)จ่ายแล้ว : </b>จำนวนเงินที่ผ่านการอนุมัติจ่ายแล้ว
                                        </li>
                                        <li style="padding-bottom:10px">
                                            <b>(5)รับเงินคืน : </b>จำนวนเงินที่รับคืนในกรณีจ่ายเงินเกิน
                                        </li>
                                        <li style="padding-bottom:10px">
                                            <b>(6)คืนโครงการ : </b>จำนวนเงินที่ส่งคืนโครงการเมื่อมีการปิดการดำเนินงาน
                                        </li>
                                        <li>
                                            <b>(7)คงเหลือ : </b>จำนวนเงินคงเหลือที่ได้รับอนุมัติดำเนินงาน<br/><span style="color:green">(7) = (1) + (2) + (3) + (4) + (5) + (6)</span>
                                        </li>
                                    </ul>
                                </div>
                            </telerik:RadToolTip>
                        </td>
                    </tr>
                </table>
            </div>
            <telerik:RadTreeList ID="tvlOperation" runat="server" AutoGenerateColumns="false"
                DataKeyNames="child_seq" ParentDataKeyNames="parent_seq" AllowLoadOnDemand="false"
                Width="945px" OnNeedDataSource="tvlOperation_NeedDataSource" 
                OnItemDataBound="tvlOperation_ItemDataBound"><%----%>
                <Columns>
                    <telerik:TreeListBoundColumn DataField="child_seq" UniqueName="child_seq" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="parent_seq" UniqueName="parent_seq" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="record_status" UniqueName="record_status" Visible="false">
                    </telerik:TreeListBoundColumn>

                    <%--<telerik:TreeListBoundColumn DataField="code" UniqueName="code" HeaderText="รหัส">
                        <HeaderStyle  HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="center" ForeColor="Black" />
                    </telerik:TreeListBoundColumn>--%>
                    <telerik:TreeListTemplateColumn DataField="name" UniqueName="name" HeaderText="">
                        <ItemTemplate>
                            <asp:Label ID="lblCode" runat="server" Text='<%# Eval("code") %>' />
                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("name") %>' />
                            <asp:LinkButton ID="cmdViewOperation" runat="server" Text='<%# Eval("name") %>' ForeColor="Blue"
                                OnClientClick='<%# string.Format("return openProjectOperationReport(\"{0}\", \"{1}\");", Eval("child_seq").ToString().Replace("/", ""), Eval("record_status")) %>'
                                />
                        </ItemTemplate>
                    </telerik:TreeListTemplateColumn>
                    <telerik:TreeListBoundColumn DataField="operation_amount" UniqueName="operation_amount" HeaderText="(1)ได้รับอนุมัติ"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <%--<telerik:TreeListBoundColumn DataField="transfer_amount" UniqueName="transfer_amount" HeaderText="(2)โอน/รับโอน"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>--%>
                    <telerik:TreeListBoundColumn DataField="reserve_amount" UniqueName="reserve_amount" HeaderText="(2)จองเงิน"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="moneyreq_amount" UniqueName="moneyreq_amount" HeaderText="(3)ตั้งเบิก"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="pay_amount" UniqueName="pay_amount" HeaderText="(4)จ่ายแล้ว"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="return_amount" UniqueName="return_amount" HeaderText="(5)รับเงินคืน"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="cancel_amount" UniqueName="cancel_amount" HeaderText="(6)คืนโครงการ"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="remain_amount" UniqueName="remain_amount" HeaderText="(7)คงเหลือ"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="90px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                </Columns>
            </telerik:RadTreeList>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
